package com.hyl.service;

import com.hyl.mapper.UserMapper;
import com.hyl.pojo.User;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @Description TODO
 * @Author hyl
 * @Date 2023/4/28 10:52
 **/
@Component
public class UserServiceImpl implements UserService {

	private UserMapper userMapper;

	@Resource
	private User user; //按名称 <property name="user" ref="userinfo"/>

	public User findById(Integer id) {
		return user;
	}
}

/*
* Autowired / Resource区别
* Autowired spring提供，按类型 [优先按类型，同一种数据类型有多个时，按名称]
* Resource  java提供，按名称[优先按名称，如果不存在，则按类型]
*
* */
